package com.cuixichang.minimalism.domain;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cuixichang.minimalism.core.security.userdetails.CredentialDetail;
import com.cuixichang.minimalism.transfer.dto.IPermissionDTO;
import com.cuixichang.minimalism.transfer.po.IPermission;

import java.util.List;

public interface IPermissionCommandService {
    IPermissionDTO insert(IPermissionDTO permissionDTO, CredentialDetail credentialDetail);
    IPermissionDTO selectByIdHasPreCheck(Long id,String systemCode,CredentialDetail credentialDetail);
    IPermissionDTO selectByCodeHasPreCheck(String permissionCode,String systemCode,CredentialDetail credentialDetail);
    boolean deleteByIdHasPreCheck(Long id,String systemCode,CredentialDetail credentialDetail);
    boolean updateByIdHasPreCheck(IPermissionDTO permissionDTO, CredentialDetail credentialDetail);
    List<IPermissionDTO> rolesHasBindingPermissions(IPermissionDTO permissionDTO,String systemCode,List<Long> roleIds);
    Page<IPermissionDTO> selectPageByConditional(IPermissionDTO permissionDTO,Long pageNo,Long pageSize, CredentialDetail credentialDetail);
    Page<IPermissionDTO> roleHasBindingPermissions(IPermissionDTO permissionDTO, Long pageNo, Long pageSize, Long roleId, CredentialDetail credentialDetail);
    Page<IPermissionDTO> roleUnBindingPermissions(IPermissionDTO permissionDTO,Long pageNo,Long pageSize,Long roleId,CredentialDetail credentialDetail);
    Page<IPermissionDTO>  routerHasBindingPermissions(IPermissionDTO dto, Long pageNo, Long pageSize, Long routerId, CredentialDetail credentialDetail);
    Page<IPermissionDTO> routerUnBindingPermissions(IPermissionDTO dto, Long pageNo, Long pageSize, Long routerId, CredentialDetail credentialDetail);
}
